﻿@using NewRen.Models;
@using NewRen.Models.ViewModel;
@model NewRen.Models.ViewModel.vEdit

@{
    UserGroup group = ViewBag.User as UserGroup;
    ViewBag.Title = "商户信息修改-更换头像";
    Layout = "~/Views/Shared/_Layout_UserGroup.cshtml";
}
<div class="ucenter-left account-left-border">
    <div class="ucneter-l-head cf">
        <div class="ulhead-headicon">
            @if (group.Picture == null)
            {
                <img src="/Images/userphoto.png" width="50" height="50"
                     alt=@group.GroupName style="border-radius:50%;" />
            }
            else
            {
                <img src="/UserGroup/ShowPicture/@group.ID" width="50"
                     alt=@group.GroupName height="50" style="border-radius:50%;" />
            }

        </div>
        <div class="ulhead-info">
            <p class="ulhead-info-uname">@group.GroupName</p>

            <div class="ulhead-info-tool">
                <a class="ulhead-icon icon-lock ucenter-mail " href="/UserGroup/PwdEdit/@group.ID" title="修改密码">
                    <div class="ucenter-mail-tip">修改密码</div>
                </a>
                <a href="/UserGroup/Edit/@group.ID"
                   class="ulhead-icon icon-setting ucenter-mail" title="设置个人信息"></a>
            </div>
        </div>
    </div>
    <div class="ucenter-l-list">
        <ul class="ullist-ul">
            <li id="uclick">
                <a href="/UserGroup/Show/@group.ID">商户中心</a>
            </li>
            <li id="uclick1" class="active">
                <a href="/UserGroup/Edit/@group.ID">商户设置</a>
            </li>
            <li id="uclick2">
                <a href="/UserGroup/ProductManager/@group.ID">商户牛人</a>
            </li>
        </ul>
    </div>
</div>
<div class="ucenter-right cf">
    <div class="ucenter-right-head">
        <span class="ucenter-right-head-show"><a href="/UserGroup/Edit/@group.ID">信息修改</a></span>
        <span class="ucenter-right-head-show"><a href="/UserGroup/PwdEdit/@group.ID">密码修改</a></span>
        <span class="ucenter-right-head-selected"><a href="/UserGroup/PictureEdit/@group.ID">更换头像</a></span>
        <span class="ucenter-right-head-show"><a href="/UserGroup/GroupPictureShow/@group.ID">宣传图片</a></span>
    </div>
    <div class="tabGroup">
        @using (Html.BeginForm("PictureEdit", "UserGroup", FormMethod.Post, new { enctype = "multipart/form-data" }))
        {
            @Html.AntiForgeryToken()
            @Html.HiddenFor(model => model.ID, new { @value = group.ID })
            <div class=" form-item">
                <div class="item-label">
                    <label>商户名：</label>
                </div>
                <div class="item-span">
                    <span class="defInfo">@group.GroupName</span>
                    @Html.HiddenFor(model => model.GroupName, new
               {
                   @value = group.GroupName
               })
                </div>
            </div>
            <div class=" form-item">
                <div class="item-label">
                    <label>头像：</label>
                </div>
                <div class="item-span">
                    @if (group.Picture == null)
                    {
                        <img src="/Images/userphoto.png" width="100" height="100"
                             style="border-radius:50%;" id="avatar" />
                    }
                    else
                    {
                        <img src="/UserGroup/ShowPicture/@group.ID" width="100" height="100"
                             style="border-radius:50%;" alt="图像" id="avatar" />
                    }
                    <input value="/UserGroup/ShowPicture/@group.ID" id="Pic" name="Pic"
                           type="hidden">
                </div>
            </div>
            <div class=" form-item">
                <div class="item-label">
                    <label>本地上传：</label>
                </div>
                <div class="item-span">
                    <input id="fileupload" type="file" name="file" style="border:0">
                </div>
            </div>
            <div class="form-item">
                <div class="item-span">
                    <input type="submit" value="保存" class="btn">
                </div>
            </div>
        }
    </div>
</div>